package com.mq.order;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author ytj
 * @date 2024/1/23
 */
@Component
@RabbitListener(queues = Demo11Message.QUEUE0)
@RabbitListener(queues = Demo11Message.QUEUE1)
@RabbitListener(queues = Demo11Message.QUEUE2)
@RabbitListener(queues = Demo11Message.QUEUE3)
public class Demo11Consumer {

    @RabbitHandler(isDefault = true)
    public void message(Demo11Message demo11Message){
        System.out.println("线程编码:"+Thread.currentThread().getId()+"接收到消息:"+demo11Message.getId());
    }
}
